package com.sykj.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.sykj.bean.card.CardGame;
import com.sykj.mapper.CardGameMapper;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @program: hongbao
 * @description:
 * @author: qiaoli
 * @create: 2020-08-05 11:45
 *
 */
@Service
public class CardGameServiceImpl extends ServiceImpl<CardGameMapper, CardGame> implements com.sykj.service.CardGameService {

    @Override
    public List<CardGame> selectByExample(Date now) {
        QueryWrapper queryWrapper=new QueryWrapper();
        queryWrapper.gt("starttime",now);
        queryWrapper.le("starttime", DateUtils.addMinutes(now,1));

        List list = this.baseMapper.selectList(queryWrapper);
        return list;
    }

    @Override
    public int updateByPrimaryKey(CardGame cardGame) {
        int i = this.baseMapper.updateById(cardGame);
        return i;
    }
}
